package com.ruoyi.blogs.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.blogs.mapper.BsTagMapper;
import com.ruoyi.blogs.domain.BsTag;
import com.ruoyi.blogs.service.IBsTagService;

/**
 * 标签Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-11-09
 */
@Service
public class BsTagServiceImpl implements IBsTagService 
{
    @Autowired
    private BsTagMapper bsTagMapper;

    /**
     * 查询标签
     * 
     * @param id 标签主键
     * @return 标签
     */
    @Override
    public BsTag selectBsTagById(Long id)
    {
        return bsTagMapper.selectBsTagById(id);
    }

    /**
     * 查询标签列表
     * 
     * @param bsTag 标签
     * @return 标签
     */
    @Override
    public List<BsTag> selectBsTagList(BsTag bsTag)
    {
        return bsTagMapper.selectBsTagList(bsTag);
    }

    /**
     * 新增标签
     * 
     * @param bsTag 标签
     * @return 结果
     */
    @Override
    public int insertBsTag(BsTag bsTag)
    {
        bsTag.setCreateTime(DateUtils.getNowDate());
        bsTag.setUpdateTime(DateUtils.getNowDate());
        return bsTagMapper.insertBsTag(bsTag);
    }

    /**
     * 修改标签
     * 
     * @param bsTag 标签
     * @return 结果
     */
    @Override
    public int updateBsTag(BsTag bsTag)
    {
        bsTag.setUpdateTime(DateUtils.getNowDate());
        return bsTagMapper.updateBsTag(bsTag);
    }

    /**
     * 批量删除标签
     * 
     * @param ids 需要删除的标签主键
     * @return 结果
     */
    @Override
    public int deleteBsTagByIds(Long[] ids)
    {
        return bsTagMapper.deleteBsTagByIds(ids);
    }

    /**
     * 删除标签信息
     * 
     * @param id 标签主键
     * @return 结果
     */
    @Override
    public int deleteBsTagById(Long id)
    {
        return bsTagMapper.deleteBsTagById(id);
    }
}